package cn.lhemi.session2.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;

@RestController
public class TestController {
    @RequestMapping("/")
    public Object test(HttpServletRequest request){
        return new HashMap<String,Object>(2){{
            put("session_id",request.getSession().getId());
            put("current",request.getSession().getAttribute("current-user"));
        }};
    }
}
